/*
 Copyright 2010 Victor Mayoral Vilches
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


//
//  NaoRemoteAppDelegate.m
//  NaoRemote
//
//  Created by Victor Mayoral Vilches on 23/11/09.
//  Copyright __MyCompanyName__ 2009. All rights reserved.
//

#import "NaoRemoteAppDelegate.h";
#import "PresentacionViewController.h";
#import "TextFieldController.h";
#import "TableViewController.h";
#import "MyNavigationViewController.h"

@implementation NaoRemoteAppDelegate

NSString *const hostNotification = @"hostNotification";
NSString *direccion_ip_host = @"10.211.55.6";
NSString *puerto_host = @"6000";

@synthesize window;



- (void)applicationDidFinishLaunching:(UIApplication *)application {    

/*
////////////////////////////////////////////////////////////////////////////////////////
                        CONFIGURACIÓN DE LA INTERFAZ
////////////////////////////////////////////////////////////////////////////////////////
 */
    //Tab Bar que emplearemos en la aplicación
    UITabBarController *tabBarController = [[UITabBarController alloc] init];
    
//    MotionViewController *viewController = [[MotionViewController alloc] initWithNibName:@"MotionView" bundle:nil];
//    viewController.title = @"Motion";
////    [viewController.tabBarItem initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:1];
//    viewController.tabBarItem.image = [UIImage imageNamed:@"preferences.gif"];
    
    PresentacionViewController *presentacionViewController = [[PresentacionViewController alloc] initWithNibName:@"PresentacionView" bundle:nil];
    presentacionViewController.tabBarItem.image = [UIImage imageNamed:@"information.gif"];
    presentacionViewController.title = @"Presentación";

    TableViewController *tableViewController = [[TableViewController alloc] init];

    MyNavigationViewController *navigationController = [[MyNavigationViewController alloc] initWithRootViewController:tableViewController];
    navigationController.tabBarItem.image = [UIImage imageNamed:@"preferences.gif"];
    navigationController.title = @"Configuración";
    
    //    TextFieldController *textField = [[TextFieldController alloc] initWithNibName:@"TextFieldController" bundle:nil];
//    textField.title = @"Configuracion";
//    textField.tabBarItem.image = [UIImage imageNamed:@"preferences.gif"];
    
    
    // Add them as children of the tab bar controller
    tabBarController.viewControllers = [NSArray arrayWithObjects:presentacionViewController, navigationController, nil];
    
    // Don't forget memory management
    [presentacionViewController release];
    [tableViewController release];
    [navigationController release];
    
    //Añadimos la pantalla de presentación de la aplicación durante unos segundos para después dar comienzo
    // con la aplicación en sí.
        
    // Add the tab bar controller's view to the window
    [window addSubview:tabBarController.view];
    [window makeKeyAndVisible];
    
}

/*
 Metodo para empezar la monitorizacion del objeto que contendra la informacion del servidor con
 el que nos queremos conectar
 */
//-(void) inicializarNotificaciones
//{
//    Host *host = [[Host alloc] initHost:@"10.211.55.1" port:@"6000"];
//}

- (void)dealloc {
    [window release];
    [super dealloc];
}

#pragma mark -
#pragma mark mostrarVista


@end
